<me:UIABPOS  x:Class="WPFExcelReport.TABGB52"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
    xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
    xmlns:me="clr-namespace:WPFExcelReport"
    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <me:UIABPOS.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIABPOS.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel  Grid.Row="0" Grid.Column="0">
            <WrapPanel > 
                <Label Content="{Binding Source={Localization:Translate Word=染色单号}}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top"/>
                <TextBox  HorizontalAlignment="Left" Width="60" FontSize="18"
                         Text="{Binding AUFKRS,ElementName=TV}"
                         CharacterCasing="Upper" Name="txtAUFKRS"/>
                <TextBox  HorizontalAlignment="Left" Width="100" FontSize="18"
                         Text="{Binding AUFLFD,ElementName=TV}"
                         Name="txtAUFLFD"/>
                <TextBox  HorizontalAlignment="Left" Width="60" FontSize="18"
                         Text="{Binding AUFPOS,ElementName=TV}"
                         Name="txtAUFPOS"/>
                <CheckBox Content="{Binding Source={Localization:Translate Word=按照染色单查询}}" HorizontalAlignment="Center" VerticalAlignment="Center" Name="ChecBox"/>
                
                <Label Content="{Binding Source={Localization:Translate Word=下单时间从}}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top"/>
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0" 
                            Text="{Binding FROMDATE,ElementName=TV}"   Width="126" SelectedDateChanged ="FROM_DATE_SelectedDateChanged" SelectedDateFormat="Short"  />
                <Label Content="{Binding Source={Localization:Translate Word=到}}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top"/>
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0"   
                            Text="{Binding ENDDATE,ElementName=TV}"   Width="126" SelectedDateChanged ="END_DATE_SelectedDateChanged" />
                <Label Content="{Binding Source={Localization:Translate Word=色号}}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top"/>
                <TextBox  HorizontalAlignment="Left" Width="100" FontSize="16"
                         Text="{Binding FABP,ElementName=TV}"
                         CharacterCasing="Upper" Name="txtcolor"/>

                <Button Content="{Binding Source={Localization:Translate Word= 查  询 }}" Name="btnSelect" HorizontalAlignment="Left" Margin="10,0,0,0" Click="QueryCommand"/>
                <Button Content="{Binding Source={Localization:Translate Word=导出Excel}}"  HorizontalAlignment="Left" Margin="10,0,0,0" Click="btnSendToExcel_Click"/>
            </WrapPanel>
        </StackPanel>
        <DataGrid  Grid.Row="1" Grid.Column="0"
            Name="dlgMaster" HorizontalAlignment="Left"  
                   ItemsSource="{Binding Source={StaticResource vwMaster}}"
                   AreRowDetailsFrozen="True" AutoGenerateColumns="False" 
                   CanUserDeleteRows="False">
            <DataGrid.Columns>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=染色}}" Binding="{Binding ABPAUFKRS}" Width="AUTO"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=单号}}" Binding="{Binding ABPAUFLFD}" Width="AUTO"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=行号}}" Binding="{Binding ABPAUFPOS}" Width="AUTO"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=第几次}}" Binding="{Binding ABAAPOS}" Width="AUTO"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=纱线名称}}" Binding="{Binding ABPART}" Width="AUTO"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=色号}}" Binding="{Binding ABPFARBE}" Width="AUTO"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=颜色}}" Binding="{Binding GSCBEZ,Converter={StaticResource gb2312}}" Width="AUTO"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=计划下锅数}}" Binding="{Binding ABPSOLLMENGE7}" Width="AUTO"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=计划重量}}" Binding="{Binding ABPSOLLMENGE5}" Width="AUTO"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=下锅数}}" Binding="{Binding ABAKDAUFTNR}" Width="AUTO"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=染批}}" Binding="{Binding ABAKDPARTIE}" Width="AUTO"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=个数}}" Binding="{Binding ABABEM1}" Width="AUTO"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=重量}}" Binding="{Binding ABABEM2}" Width="AUTO"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=时间}}" Binding="{Binding ABAVERSDAT}" Width="AUTO"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=倒筒}}" Binding="{Binding ABPZUGSTK}"  Width="AUTO"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</me:UIABPOS>
